package org.jeecg.modules.fund.controller;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.fund.entity.FundLibrary;
import org.jeecg.modules.fund.entity.StockIndex;
import org.jeecg.modules.fund.service.IStockIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "全球指数")
@RequestMapping("/sys/stock/index")
@Slf4j
public class StockIndexController {
    @Autowired
    private IStockIndexService stockIndexService;

    /**
     * 获取指数详情
     * @param id
     * @return
     */
    @RequestMapping(value = "/detail", method = RequestMethod.GET)
    public Result<StockIndex> detail(@RequestParam(name = "id") String id) {
        StockIndex index = stockIndexService.getById(id);
        return Result.OK(index);
    }
}
